// 定一个公共类，类里有一个renderJsonSuccess方法，方便返回数据
class BaseController {
  static renderJsonSuccess(data = "", code = 200, msg = "success") {
    return {
      code: code,
      msg: msg,
      data: data,
    };
  }

  static renderJsonError(data = "", code = 500, msg = "fail") {
    return {
      code: code,
      msg: msg,
      data: data,
    };
  }
}

module.exports = BaseController;
